      SUBROUTINE TGLOC03(NTARGS,TARGNAME,NPARMS,PARMS,
     *         KSYSNAT,KCENNAT,TARGUNIT,LUERR,IERR)
      IMPLICIT REAL*8 (A-H,O-Z)
C
C THIS ROUTINE IS PART OF THE TOSS TARGET LOCATION PACKAGE, TGLOC. IT
C COMPUTES THE UNIT DIRECTION VECTOR FOR FIXED CELESTIAL TARGETS.
C
C
C VAR     DIM    TYPE I/O DESCRIPTION
C ---     ---    ---- --- -----------
C
C NTARGS   1      I*4  I  NUMBER OF TARGETS TO BE PROCESSED.
C                         IF ZERO OR NEGATIVE, NONE ARE PROCESSED.
C
C TARGNAME NTARGS CH*16 I TARGET NAMES;  USED FOR ERROR MESSAGES,
C                         OTHERWISE THE NAME HAS NO SIGNIFICANCE.
C
C NPARMS   1      I*4  I  THE NUMBER OF PARAMETERS SUPPLIED IN THE PARMS
C                         ARRAY.  MUST BE 2 OR GREATER.
C
C PARMS           R*8  I  SAME AS TGLOC'S DESCRIPTION OF PARMS FOR
C    NPARMS,NTARGS        TARGET TYPE 3.
C
C KSYSNAT  1      I*4  O  IDENTIFIES THE NATURAL COORDINATE SYSTEM'S
C                         ORIENTATION.  IS SET TO 1 TO INDICATE THE
C                         ORIENTATION IS MEAN EARTH EQUATOR AND
C                         EQUINOX OF 1950.0
C
C KCENNAT  1      I*4  O  IDENTIFIES THE NATURAL COORDINATE SYSTEM'S
C                         ORIGIN.  IS SET TO 9999 TO INDICATE THE ORIGIN
C                         IS IRRELEVANT.
C
C TARGUNIT 3,NTARGS R*8 O TARGUNIT(-,I) IS THE UNIT VECTOR OF THE I'TH
C                         TARGET.  IN MEAN OF 1950.0
C
C LUERR    1      I*4  I  FORTRAN UNIT NUMBER FOR ERROR MESSAGES.
C                          = 0/NEGATIVE, NO MESSAGES POSSIBLE.
C
C IERR     1      I*4  O  ERROR RETURN FLAG.
C                          = 0, NO ERROR.
C                          = OTHERWISE, ERROR.
C
C***********************************************************************
C
C BY C PETRUZZO, GSFC/742, 8/85.
C        MODIFIED....
C
C***********************************************************************
C
      REAL*8 PARMS(NPARMS,1),TARGUNIT(3,1)
      CHARACTER*16 TARGNAME(1)
C
      IERR = 0
      KSYSNAT = 1        ! ORIENTATION IS MEAN OF 1950.0
      KCENNAT = 9999     ! INDEPENDENT OF THE ORIGIN
      IF(NTARGS.EQ.0) GO TO 9999
C
C GET TARGET DIRECTION VECTOR IN 'NATURAL' SYSTEM.
C
      DO ITARG=1,NTARGS
        CALL TGLOC03A(NPARMS,PARMS(1,ITARG),TARGNAME(ITARG),
     *         LUERR,IERR1)
        IF(IERR1.EQ.0) THEN
          RACN=PARMS(1,ITARG)
          DECL=PARMS(2,ITARG)
          CALL XYZSPH(1,RACN,DECL,1.D0,TARGUNIT(1,ITARG),1.D0)
        ELSE
          IERR = 1
          TARGUNIT(1,ITARG) = 'ERROR'
          TARGUNIT(2,ITARG) = 'ERROR'
          TARGUNIT(3,ITARG) = 'ERROR'
          END IF
        END DO
C
 9999 CONTINUE
      RETURN
      END
